<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=Bs0HDvUqWnyUBz3v7xcqF85InPazf81o"></script>
    <title>跑步</title>
</head>

<body>
    <div class="app_run dpflex fdcolumn">
        <!-- 开始跑步 -->
        <div class="start center">
            GO
        </div>
        <!-- 累计跑步 -->
        <div class="addup">
            <p>目前累计跑步距离</p>
            <p><span class="km">0</span>公里</p>
        </div>

        <!-- 地图盒子 -->
        <div id="MAP"></div>


    </div>

    <script>
        var map = new BMap.Map("MAP");
        var point = new BMap.Point(114.3162001,30.58108413);
        map.centerAndZoom(point, 12);

        var geolocation = new BMap.Geolocation();
        geolocation.getCurrentPosition(function (r) {
            if (this.getStatus() == BMAP_STATUS_SUCCESS) {
                var mk = new BMap.Marker(r.point);
                map.addOverlay(mk);
                map.panTo(r.point);
                console.log('您的位置：' + r.point.lng + ',' + r.point.lat);
            } else {
                console.log('failed' + this.getStatus());
            }
        });
    </script>
</body>

</html>